package com.matrix.java.chap_07;

import java.util.Arrays;

/*
    随机数选择器
 */
public class Ex7_13 {
    public static void main(String[] args) {
        System.out.println(getRandom(1, 2, 3, 4, 5, 6));
    }

    public static int getRandom(int... numbers) {
        int random;
        do {
            random = (int) (Math.random() * 54) + 1;
        } while (Arrays.binarySearch(numbers, random) >= 0);
        return random;
    }
}
